package com.houger.ddd.seckill.constant;

import java.util.Arrays;

public enum RewardItemTypeEnum {

    NONE( 0, "无"),
    COUPON( 1, "优惠券"),
    POINTS( 2, "积分"),
    GOODS( 3, "商品"),
    LUCK_DRAW_COUNT( 4, "抽奖次数"),
    REWARD_PACKAGE( 99, "奖品包"),
    ;
    private int value;
    private String desc;
    private String issueClass;

    RewardItemTypeEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static RewardItemTypeEnum getEnumByValue(int value) {
        return Arrays.stream(RewardItemTypeEnum.values()).filter(a -> a.value == value).findFirst().orElse(null);
    }

}
